﻿@using Orchard.Utility.Extensions;
@using Orchard.Mvc.Html;
@using Orchard.Mvc.Extensions;
@using System.Linq;
@using RM.Localization.ViewModels;

@{
    var cultures = Model.Cultures as IEnumerable<CookieCultureItemViewModel> ?? new CookieCultureItemViewModel[0];
}

<ul class="inline-list-culture-selector">
    @foreach (var c in cultures) {
        if (!c.Current) {
            <li>@Html.ActionLink(c.CultureItem.ShortName.ToUpper(), "SetCulture", "CookieCulture", new { Area = "RM.Localization", culture = c.CultureItem.Culture.ToLower(), returnUrl = c.ReturnUrl }, new { rel = c.Rel })</li>
        }
        else
        {
        <li><strong>@Html.ActionLink(c.CultureItem.ShortName.ToUpper(), "SetCulture", "CookieCulture", new { Area = "RM.Localization", culture = c.CultureItem.Culture.ToLower(), returnUrl = c.ReturnUrl }, new { rel = c.Rel })</strong></li>
        }
    }
    <li>@Html.ActionLink("X", "ResetCulture", "CookieCulture", new { Area = "RM.Localization", returnUrl = Url.Content("~/") }, new { rel = "nofollow" })</li>
</ul>
